package tpo.fallback;

import com.github.pagehelper.PageInfo;
import dto.Dto;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
import pojo.BuyOrder;
import pojo.Journal;
import pojo.Pay_order;
import pojo.Receipt_order;
import pojo.finance.Day;
import pojo.finance.Fukuandan;
import pojo.finance.Kehuduizhang;
import pojo.finance.Zijinduizhang;
import tpo.client.Receipt_oreder_Client;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@Component
public class NewsClientFallBack implements FallbackFactory<Receipt_oreder_Client> {


    @Override
    public Receipt_oreder_Client create(Throwable throwable) {
        //用于后台输出报错
        throwable.printStackTrace();

        return new Receipt_oreder_Client() {
            @Override
            public Dto<PageInfo<Receipt_order>> allreceipt_order(Map<String, Object> map) {
                Dto<PageInfo<Receipt_order>> dto = new Dto<>();
                dto.setSuccess(false);
                dto.setMsg("服务器出错，请稍后再试！");
                return dto;
            }

            @Override
            public Dto<Receipt_order> selectReceipt_order(String code) {
                Dto<Receipt_order> dto=new Dto<>();
                dto.setSuccess(false);
                dto.setMsg("服务器出错，请稍后再试！");
                return dto;
            }


            @Override
            public Dto<List<Receipt_order>> allReceipt_order() {
                Dto<List<Receipt_order>> dto = new Dto<>();
                dto.setSuccess(false);
                dto.setMsg("服务器出错，请稍后再试！");
                 return  dto;
            }

            @Override
            public Dto<BigDecimal> selectallReceipt_ordermoney(String code) {
                Dto<BigDecimal> dto=new Dto<>();
                dto.setSuccess(false);
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setCode(3);
                return dto;
            }

            @Override
            public Dto addReceipt_order(Receipt_order receipt_order) {
                Dto dto=new Dto();
                dto.setSuccess(false);
                dto.setMsg("服务器出错，请稍后再试！");
                return dto;
            }

            @Override
            public Dto zuofei(Map<String,Object> map) {
                Dto dto=new Dto();
                dto.setSuccess(false);
                dto.setCode(1);
                dto.setMsg("服务器出错，请稍后再试！");
                return dto;
            }

            @Override
            public Dto shenhe(Map<String, Object> map) {
                Dto dto=new Dto();
                dto.setSuccess(false);
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setCode(2);
                return dto;
            }

            @Override
            public Dto<PageInfo<Journal>> alljournal(Map<String, Object> map) {
                Dto<PageInfo<Journal>> dto=new Dto<>();
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setSuccess(false);
                dto.setCode(3);
                return dto;
            }

            @Override
            public Dto<PageInfo<Fukuandan>> allPay_order(Map<String, Object> map) {
                Dto<PageInfo<Fukuandan>> dto=new Dto<>();
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setSuccess(false);
                dto.setCode(4);
                return dto;
            }

            @Override
            public Dto addPay_order(Pay_order pay_order) {
                Dto dto=new Dto();
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setSuccess(false);
                dto.setCode(5);
                return dto;
            }

            @Override
            public  Dto fukuanzuofei(Map<String,Object> map) {
                Dto dto=new Dto();
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setSuccess(false);
                dto.setCode(6);
                return dto;
            }

            @Override
            public Dto selectpay_order(String s) {
                Dto dto=new Dto();
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setSuccess(false);
                dto.setCode(7);
                return dto;
            }

            @Override
            public Dto fukuanshenhe(Map<String, Object> map) {
                Dto dto=new Dto();
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setSuccess(false);
                dto.setCode(8);
                return dto;
            }

            @Override
            public Dto<PageInfo<Kehuduizhang>> selectusermoney(Map<String, Object> map) {
                Dto dto=new Dto();
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setSuccess(false);
                dto.setCode(9);
                return dto;
            }

            @Override
            public Dto<Kehuduizhang> selectusersum() {
                Dto dto=new Dto();
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setSuccess(false);
                dto.setCode(10);
                return dto;
            }

            @Override
            public Dto<Kehuduizhang> selectoneusersum(String s) {
                Dto dto=new Dto();
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setSuccess(false);
                dto.setCode(11);
                return dto;
            }

            @Override
            public Dto<PageInfo<BuyOrder>> selectoneuseralldan(Map<String, Object> map) {
                Dto dto=new Dto();
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setSuccess(false);
                dto.setCode(12);
                return dto;
            }

            @Override
            public Dto<PageInfo<Zijinduizhang>> selectdangtianzhang( Map<String,Object> map) {
                Dto dto=new Dto();
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setSuccess(false);
                dto.setCode(13);
                return dto;
            }

            @Override
            public Dto<PageInfo<Journal>> selectzijinmingxi(Map<String, Object> map) {
                Dto dto=new Dto();
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setSuccess(false);
                dto.setCode(14);
                return dto;
            }

            @Override
            public Dto<List<Day>> zijinzhexiantu() {
                Dto dto=new Dto();
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setSuccess(false);
                dto.setCode(15);
                return dto;
            }

            @Override
            public Dto<List<Receipt_order>> codeselectallreceipt(String s) {
                Dto dto=new Dto();
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setSuccess(false);
                dto.setCode(16);
                return dto;
            }

            @Override
            public Dto<List<Pay_order>> codeselectallfukuandan(String s) {
                Dto dto=new Dto();
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setSuccess(false);
                dto.setCode(17);
                return dto;
            }

            @Override
            public Dto selectallokfukuandan(String s) {
                Dto dto=new Dto();
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setSuccess(false);
                dto.setCode(18);
                return dto;
            }

            @Override
            public Dto upPay_order(Map<String, Object> map) {
                Dto dto=new Dto();
                dto.setMsg("服务器出错，请稍后再试！");
                dto.setSuccess(false);
                dto.setCode(19);
                return dto;
            }


        };
    }






}